package com.deng.api.controller;

import com.deng.api.entity.CloudCompany;
import com.deng.api.service.ICloudCompanyService;
import com.deng.commons.common.BaseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author deng
 * @since 2022-08-10
 */
@RestController
@Api(tags = "公司相关接口")
@RequestMapping("/api/company")
public class CloudCompanyController {
    @Autowired
    private ICloudCompanyService iCloudCompanyService;

    @GetMapping("/all")
    @ApiOperation("获取所有的公司信息")
    public BaseResult getAll(Integer page, Integer size, CloudCompany cloudCompany){
        if (page==null||size==null){
            page = 1;
            size=999;
        }
        return iCloudCompanyService.getCompanies(page,size,cloudCompany);
    }
}
